import connect
client = connect.connect()

# 使用数据库test
db = client['test']

# 获取对应的集合（列表）
collection = db.test

# 展示列表的所有内容
def showCollectionData(c):
    result = c.find()
    for item in result:
        print(item)

showCollectionData(collection)
# 删除一条key为test2
# collection.delete_one({ "key": "test2" })
# showCollectionData(collection)

# 删除多条age为18的数据
collection.delete_many({ "age": 18 })
showCollectionData(collection)

